home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / mathematica / tex-mma.tar_z / tex-mma / PSTeX.m < prev    next >
Text File  |  1991-03-10  |  2KB  |  49 lines

  1. (* 2/25/1991 Dan Dill dan@chem.bu.edu *)
  2.  
  3. (* This version assumes the Mathematica prolog file will be avilable in the
  4.    printer.  The current prolog is mma.pro.1.2 and is specific to version 1.2
  5.    of Mathematica.  It will change in version 2.0.  The fontsize (at
  6.    PSTeXHeight) is set as PSTeXFontsize  to 7 bp (72 bp per inch).  PSTeXpro.m
  7.    is a version of PSTeX that includes the prolog in the file, using psfix,
  8.    and so should work unchanged in version 2.0. *)
  9.  
  10. PSTeX::usage = "PSTeX[-graphics-, \"file\"].  Process a graphics object to a
  11. PostScript file for inclusion in a TeX document (using \\psfig).  Quotes are
  12. required around the file name and suffix `.ps' is added.  The graphic object
  13. is scaled and shifted so that it can be included in the TeX document directly
  14. (for example, with \\psfig{figure=file.ps}).  The height and font size of the
  15. scaled graphic are PSTeXHeight (default 100) and PSTeXFontsize in big points
  16. (72 bp per inch). For example,
  17. \n
  18. \n
  19. \t PSTeX[myplot, \"p4/myplot\"]
  20. \n
  21. \n
  22.   will convert the graphics object myplot to the PostScript file myplot.ps in
  23. the subdirectory p4 of the current directory.
  24.  
  25. \n
  26. \n
  27.   Notes: The Mathematica PostScript prolog is *not* included in the file and
  28. the prolog must be downloaded before the file can be printed.  PSTeX yields a
  29. graphic with PSTeXHeight and without centering or margins, and so is not
  30. generally suitable for printing.  Use PSFile to produce a graphic in a file,
  31. centered and scaled to fill the whole page."
  32.  
  33. PSTeX::file = "Graphics being processed (without prolog) to file \"`1`\".";
  34. PSTeXHeight = 100;
  35. PSTeXFontsize = 7;
  36. PSTeX[g_, f_String] := Block[{filename},
  37.     filename = StringJoin[f, ".ps"];
  38.     Message[PSTeX::file, filename];
  39.     Display[StringJoin[
  40.         "! ",
  41.         "addBBox",
  42.         " ",
  43.         ToString[PSTeXHeight],
  44.         " ",
  45.         ToString[PSTeXFontsize],
  46.         " > ",
  47.         filename
  48.         ], g];];
  49.